
import { type IComponentConfig, ChannelEnum } from '../../types'
import { buttonTypes, sizes } from '../util'

const props: IComponentConfig[] = [{
  type: 'select',
  component: 'eSelect',
  label: '按钮类型',
  model: 'type',
  props: {
    transfer: true,
    dataSource: {
      type: 'static',
      value: buttonTypes
    }
  },
  defaultValue: 'primary'
}, {
  type: 'select',
  component: 'eSelect',
  label: '按钮大小',
  model: 'size',
  props: {
    transfer: true,
    dataSource: {
      type: 'static',
      value: sizes
    }
  },
  defaultValue: 'default'
}, {
  type: 'input',
  component: 'eInput',
  label: '按钮文字',
  model: 'text',
  defaultValue: '普通按钮'
}, {
  type: 'switch',
  component: 'eSwitch',
  label: '幽灵属性',
  model: 'ghost',
  defaultValue: false
}]

const events: IComponentConfig[] = [{
  type: 'codeEditor',
  component: 'CodeEditor',
  model: 'click',
  label: 'click',
  defaultValue: `function fn(page, e) {
}
  `
}]

const drag = {
  compName: 'eButton',
  label: '按钮',
  classify: {
    label: '基础',
    value: 'basic'
  },
  channel: ChannelEnum.PC,
  group: {
    label: '按钮',
    value: 'button'
  },
  icon: 'icon-skyatlas'
}

export default {
  drag,
  props,
  events
}
